<template>
    <div>
        <van-list
            v-model="loading"
            :finished="finished"
            finished-text="没有更多了"
            @load="onLoad"
            >
            <van-cell v-for="item in dataList" :key="item.id" :title="item.houseName" @click="toHouse(item.id)"/>
        </van-list>
    </div>
</template>
<script>
export default {
    data(){
        return {
            dataList: [],
            loading: false,
            finished: false
        }
    },
    methods: {
        onLoad:function(){
            window.setTimeout(()=>{
                this.loading = false
                this.dataList = [
                    { houseName: '哈哈哈',id: 3045},
                    { houseName: '我的',id: 4317},
                    { houseName: '来了',id: 6236},
                    { houseName: '久久',id: 2148}
                ]
                this.finished = true;
            },1000)
        },
        toHouse:function(id){
            this.$router.push('/House/'+id)
        }
    }
}
</script>